package com.winning.pmph.entity;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import javax.persistence.Table;
import java.util.List;

@Data
@Table(name = "EXERCISE_BOOK")
public class ExerciseBook extends Book {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId
    private String id;

    /**
     * 图书名称
     */
    private String name;

    /**
     * 书号
     */
    @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    private String isbn;

    /**
     * 状态 (查询参数可能为null, 使用包装类)
     */
    private Integer status;

    /**
     * 版本 (查询参数可能为null, 使用包装类)
     */
    private Integer version;

    /**
     * 图书分类
     */
    private JSONArray category;

    /**
     * 元数据
     */
    private JSONObject metadata;

    /**
     * 导入状态 (查询参数可能为null, 使用包装类)
     */
    private Integer importStatus;

    /**
     * 导入时间
     */
    private String importDate;

    @TableField(exist = false)
    private JSONArray importDateRange;
    @TableField(exist = false)
    private Integer markedStatus;
    @TableField(exist = false)
    private String markedBy;
    @TableField(exist = false)
    private String markedRate;
    @TableField(exist = false)
    private List<BookArticle> frontArticleList;

    @TableField(exist = false)
    private List<ExerciseEntry> exerciseEntryList;
    @TableField(exist = false)
    private List<ExerciseGroup> exerciseGroupList;

    @TableField(exist = false)
    private  List<BookArticle> backArticleList;

    @TableField(exist = false)
    private  List<BookCatalogItem> frontCatalogItemList;
    @TableField(exist = false)
    private  List<BookCatalogItem> bodyCatalogItemList;
    @TableField(exist = false)
    private  List<BookCatalogItem> backCatalogItemList;

    @TableField(exist = false)
    private  List<BookCatalogItem> catalogItemList;

    @TableField(exist = false)
    private String filePath;
    @TableField(exist = false)
    private String unzipPath;

    /**
     * 0 电子书(只有XMl文件) 1 电子书+增值服务(既有xml文件又有增值服务) 2增值服务(只有增值服务,没有xml文件)
     */
    @TableField(exist = false)
    private Integer bookType;

    /**
     * 当book_type 是1,2时,该字段起作用,质检状态，即付型状态，1未付型，2已付型 只有已付型的图书才能发布和推送
     */
    @TableField(exist = false)
    private Integer qualityStatus;
}
